package com.huilian.cloud.module.system.dal.mysql.datascope;

import java.util.*;


import com.huilian.cloud.framework.common.pojo.PageResult;
import com.huilian.cloud.framework.mybatis.core.mapper.BaseMapperX;
import com.huilian.cloud.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.huilian.cloud.module.system.controller.admin.datascope.vo.DatascopePageReqVO;
import com.huilian.cloud.module.system.dal.dataobject.datascope.DatascopeDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 数据权限 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface DatascopeMapper extends BaseMapperX<DatascopeDO> {

    default PageResult<DatascopeDO> selectPage(DatascopePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DatascopeDO>()
                .eqIfPresent(DatascopeDO::getGroupRootId, reqVO.getGroupRootId())
                .orderByDesc(DatascopeDO::getDataScopeId));
    }

}